Skip to content

feat(widgets): intro and gallery sheet#972

Open
ovitrif wants to merge 17 commits into
masterfrom
feat/add-widget-bottom-sheets
Open

feat(widgets): intro and gallery sheet#972
ovitrif wants to merge 17 commits into
masterfrom
feat/add-widget-bottom-sheets

Conversation

@ovitrif
Copy link
Copy Markdown
Collaborator

@ovitrif ovitrif commented May 26, 2026

Closes #966

Description

This PR:

  1. Adds the one-time Widgets intro screen and in-sheet flow, routeing the drawer Widgets entry to either the intro or the wallet overview widgets section based on whether the intro has been seen.
  2. Moves the Add Widget gallery plus widget preview/edit screens into a large gradient-backed bottom sheet with internal in-sheet navigation.
  3. Updates the Add Widget gallery to match the Figma v61 layout, including large sheet sizing, scrolling behavior, equal picker card heights, reused widget preview components, and reliable full-card taps.
  4. Rewires save/edit/back behavior so selected widgets save through the existing widget flow, append to the current widget set, and navigation lands on the wallet overview widgets section afterwards.
  5. Adds the widget flow journeys for android-cli, Compose/navigation coverage, and the changelog fragment for this user-facing change.

Preview

addwidget.mp4

QA Notes

Manual Tests

Optional local QA patches, for a disposable test build only. Apply one or both before ./gradlew installDevDebug; do not commit them. Undo by running git apply -R with the same patch.

Shorten backup retry/failure waits from minutes to seconds:

git apply <<'PATCH'
diff --git a/app/src/main/java/to/bitkit/repositories/BackupRepo.kt b/app/src/main/java/to/bitkit/repositories/BackupRepo.kt
--- a/app/src/main/java/to/bitkit/repositories/BackupRepo.kt
+++ b/app/src/main/java/to/bitkit/repositories/BackupRepo.kt
@@ -699,10 +699,10 @@ class BackupRepo @Inject constructor(
         private const val TAG = "BackupRepo"
 
         private const val MINUTE_IN_MS = 60_000
-        private const val BACKUP_DEBOUNCE = 5000L // 5 seconds
-        private const val BACKUP_CHECK_INTERVAL = 60 * 1000L // 1 minute
-        private const val FAILED_BACKUP_CHECK_TIME = 30 * 60 * 1000L // 30 minutes
-        private const val FAILED_BACKUP_NOTIFICATION_INTERVAL = 10 * 60 * 1000L // 10 minutes
+        private const val BACKUP_DEBOUNCE = 500L // QA: 0.5 seconds
+        private const val BACKUP_CHECK_INTERVAL = 2 * 1000L // QA: 2 seconds
+        private const val FAILED_BACKUP_CHECK_TIME = 10 * 1000L // QA: 10 seconds
+        private const val FAILED_BACKUP_NOTIFICATION_INTERVAL = 5 * 1000L // QA: 5 seconds
         private const val SYNC_STATUS_DEBOUNCE = 500L // 500ms debounce for sync status updates
         private val VSS_TIMESTAMP_TIMEOUT = 60.seconds
     }
PATCH

Shorten Home widget headline/fact rotation while visually checking saved widgets:

git apply <<'PATCH'
diff --git a/app/src/main/java/to/bitkit/ui/screens/wallets/HomeViewModel.kt b/app/src/main/java/to/bitkit/ui/screens/wallets/HomeViewModel.kt
--- a/app/src/main/java/to/bitkit/ui/screens/wallets/HomeViewModel.kt
+++ b/app/src/main/java/to/bitkit/ui/screens/wallets/HomeViewModel.kt
@@ -184,14 +184,14 @@ class HomeViewModel @Inject constructor(
     private suspend fun startArticleRotation(articlesList: List<ArticleModel>) {
         while (_uiState.value.showWidgets && articlesList.isNotEmpty()) {
             _currentArticle.update { articlesList.randomOrNull() }
-            delay(30.seconds)
+            delay(3.seconds)
         }
         _currentArticle.update { null }
     }
 
     private suspend fun startFactsRotation(factList: List<String>) {
         while (_uiState.value.showWidgets && factList.isNotEmpty()) {
             _currentFact.update { factList.randomOrNull() }
-            delay(20.seconds)
+            delay(3.seconds)
         }
         _currentFact.update { null }
     }
PATCH

Use Dev Settings → Reset widgets intro flag to retest the first-run widgets path, and Dev Settings → Reset Widgets State when you want the default widget list again.

  • 1. Drawer → Widgets with intro unseen: Widgets Intro opens with "Hello, Widgets", "View & Organize", and "Add Widget" visible.
  • 2. Widgets Intro → Add Widget → Bitcoin Weather → Save Widget: Add Widget opens as an in-sheet gallery, the intro remains visible behind the backdrop, Weather preview opens in-sheet, and save lands on the wallet overview widgets section with Bitcoin Weather appended last.
  • 3. Widgets Intro → View & Organize with widgets enabled: lands on the wallet overview widgets section.
  • 4. Drawer → Widgets with intro already seen and widgets enabled: wallet overview widgets section opens directly and "Hello, Widgets" intro screen is not visible.
  • 5. Widgets disabled → Drawer → Widgets: Add Widget opens in-sheet with disabled picker cards and Enable in Settings visible; Enable in Settings opens Widgets Settings.
  • 6. Wallet Overview widgets section → Add Widget → scroll to Bitcoin Calculator → tap card: the large Add Widget sheet scrolls without content hiding behind the sheet top area, and Calculator preview opens in-sheet.
  • 7a. regression: Add Widget gallery → tap Bitcoin Price chart line: Price preview opens in-sheet and no chart tooltip opens.
    • 7b. regression: Add Widget gallery → tap Bitcoin Headlines content: Headlines preview opens in-sheet and no external URL opens.
  • 8. Pubky authenticated session restored → Profile Choice: auto-nav lands on Profile instead of staying on the choice screen.
  • 9. Optional backup timing patch applied + stale WALLET backup status present at launch → Settings → Backup: WALLET leaves running=true and completes after the shortened debounce instead of waiting for another data change.

Automated Checks

  • Compose UI tests added/updated for Widgets intro actions, drawer Widgets routing, Add Widget gallery layout/scrolling/safe-area behavior, reliable picker taps, and converted sheet previews.
  • Unit coverage added for widget route mapping in app/src/test/java/to/bitkit/ui/sheets/WidgetsRouteTest.kt.
  • Unit coverage added for stale running backup retry in app/src/test/java/to/bitkit/repositories/BackupRepoTest.kt.
  • Unit coverage added for Pubky restored-session profile navigation in app/src/test/java/to/bitkit/ui/screens/profile/PubkyChoiceViewModelTest.kt.
  • Android CLI journeys added under journeys/widgets/ for widgets intro and add widgets flow.
  • Ran ./gradlew compileDevDebugKotlin compileDevDebugAndroidTestKotlin detekt testDevDebugUnitTest.
  • Ran ./gradlew connectedDevDebugAndroidTest -Pandroid.testInstrumentationRunnerArguments.class=to.bitkit.ui.screens.widgets.AddWidgetsSheetContentTest.
  • CI: build, lint, detekt, and E2E checks are green on the latest pushed commit.

@ovitrif ovitrif self-assigned this May 26, 2026
@ovitrif ovitrif changed the title feat: add widget sheet flow feat: add widget gallery sheet May 28, 2026
@ovitrif ovitrif changed the title feat: add widget gallery sheet feat(widgets): intro and galley bottom sheet May 28, 2026
@ovitrif ovitrif changed the title feat(widgets): intro and galley bottom sheet feat(widgets): intro and gallery sheet May 28, 2026
@ovitrif ovitrif marked this pull request as ready for review May 28, 2026 00:41
@ovitrif ovitrif requested review from jvsena42 and piotr-iohk May 28, 2026 00:41
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 786e4c67dd

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/src/main/java/to/bitkit/ui/components/DrawerMenu.kt Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c0d7a07c0d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/src/main/java/to/bitkit/ui/sheets/WidgetsSheet.kt Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e1242fc8ed

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/src/main/java/to/bitkit/ui/sheets/WidgetsSheet.kt
@ovitrif ovitrif force-pushed the feat/add-widget-bottom-sheets branch from 8e342f7 to 5395c78 Compare May 28, 2026 01:53
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5395c78005

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/src/main/java/to/bitkit/ui/sheets/WidgetsSheet.kt Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: be6c60fec7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/src/main/java/to/bitkit/ui/screens/widgets/AddWidgetsScreen.kt
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 28e5eb4f7e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/src/main/java/to/bitkit/ui/screens/wallets/HomeScreen.kt
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 565e1b2bdb

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/src/main/java/to/bitkit/ui/ContentView.kt Outdated
piotr-iohk
piotr-iohk previously approved these changes May 28, 2026
Copy link
Copy Markdown
Collaborator

@piotr-iohk piotr-iohk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Tested on device and Pixel 6, Pixel 8 and a small-device emulator, in English and Polish.

  • Widgets intro behaves correctly and is shown only once.
  • Adding and removing widgets works.
  • Editing widgets works.
  • Widgets persist after restarting the app.

Copy link
Copy Markdown
Member

@jvsena42 jvsena42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Bug in top padding
image

Edit: Edited after update my branch

@jvsena42
Copy link
Copy Markdown
Member

Nice solution for this comment, is it documented in Figma? I couldn't find it

Screen_recording_20260528_090154.webm

@ovitrif
Copy link
Copy Markdown
Collaborator Author

ovitrif commented May 28, 2026

Nice solution for this comment, is it documented in Figma? I couldn't find it

Screen_recording_20260528_090154.webm

Not even, but I will signal it in Figma in the thread you shared, thx sir 🙏🏻

PS. Just codex being smart, I didn't even check until now; thanks for caring for this detail 🙏🏻

@ovitrif
Copy link
Copy Markdown
Collaborator Author

ovitrif commented May 28, 2026

Disabled

disabled.mp4
Behavior of Widgets menu item when Widgets are disabled in Settings > General

jvsena42

This comment was marked as resolved.

@ovitrif
Copy link
Copy Markdown
Collaborator Author

ovitrif commented May 29, 2026

  • Bug in top padding

@jvsena42 How did you repro this? I only see it if I don't swipe down enough after scrolling…

sheet.mp4

PS. This was an issue before the latest updates to the PR, you might've had a stale state locally?!

@jvsena42
Copy link
Copy Markdown
Member

jvsena42 commented May 29, 2026

How did you repro this? I only see it if I don't swipe down enough after scrolling…

It always happens to me, tested on Medium Phone, API 37.0, synced branch

Screen_recording_20260529_080922.webm

@ovitrif
Copy link
Copy Markdown
Collaborator Author

ovitrif commented May 29, 2026

How did you repro this? I only see it if I don't swipe down enough after scrolling…

It always happens to me, tested on Medium Phone, API 37.0, synced branch

Thanks, figured out it has to do with the bottom safe-area constraints, going to remove those.

@ovitrif
Copy link
Copy Markdown
Collaborator Author

ovitrif commented May 29, 2026

Resolved in 4214c8b

@jvsena42
Copy link
Copy Markdown
Member

Starting review

Comment thread app/src/main/java/to/bitkit/ui/screens/widgets/AddWidgetsScreen.kt Outdated
Comment thread app/src/main/java/to/bitkit/ui/screens/widgets/AddWidgetsScreen.kt
Comment thread app/src/main/java/to/bitkit/ui/screens/widgets/AddWidgetsScreen.kt
@jvsena42
Copy link
Copy Markdown
Member

It looks like GH is not displaying a warning anymore when the branch is behind master, neither the "update" button

@ovitrif ovitrif force-pushed the feat/add-widget-bottom-sheets branch from 6170893 to 0093b2c Compare May 30, 2026 01:25
@ovitrif
Copy link
Copy Markdown
Collaborator Author

ovitrif commented May 30, 2026

Resolved in 0093b2c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: add widget intro and add-widget grid

3 participants